/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller;

import java.io.FileInputStream;
import java.sql.*;
import java.util.Properties;

/**
 *
 * @author Camilo
 */
public class conexionMySql {

    /*//private String url = "jdbc:mysql://mysql-SellBost.jelastic.servint.net/sellbost";
    private String url = "jdbc:mysql://mysql-SellBoost.jelastic.servint.net/sellbost";
    private String user = "root";
    private String password = "ndETQW9ps6";*/
    
    private String url = "jdbc:mysql://localhost/sellbost";
    private String user = "root";
    private String password = "";

    public Connection comenzarDb() {
        Connection link = null;
        try {
            Class.forName("org.gjt.mm.mysql.Driver");
            link = DriverManager.getConnection(this.url, this.user, this.password);
        } catch (Exception e) {
            System.out.println("error");
        }
        return link;
    }
    /*
     * Connection link = null; Properties prop = new Properties(); try {
     * prop.load(new FileInputStream(System.getProperty("user.home") +
     * "/mydb.cfg")); String host = prop.getProperty("host").toString(); String
     * username = prop.getProperty("username").toString(); String password =
     * prop.getProperty("password").toString(); String driver =
     * prop.getProperty("driver").toString(); Class.forName(driver); link =
     * DriverManager.getConnection(host, username, password); } catch (Exception
     * e) { System.out.println("error"); } return link;
     *
     */
}